<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<div class="mainbar">
	<div class="page-head">
		<h2 class="pull-left">
			<i class="icon-tasks"></i>
			<spring:message code="menu.updateSlider.label" />
		</h2>
		<div class="clearfix"></div>

	</div>
	<div class="matter background_seller">
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span7 offset2">
					<div class="widget">
						<div class="widget-head">
							<div class="pull-left">
								<spring:message code="menu.sliderInfo.label" />
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="widget-content">
							<div class="padd">
								<div class="offset1">
									<form:form id="updateSliderForm" action="updateSlider"
										method="POST" class="form-horizontal" modelAttribute="slider"
										enctype="multipart/form-data">
										<form:hidden path="id"/>
										<div class="control-group">
											<label class="control-label admin_Label" for="sliderimage">Hình ảnh</label> 
											<div class="controls">
											<img src="../resources/${fn:toLowerCase(image.imageType)}-images/${image.name}" style="width: 100px; height: 100px"/>
											</div> 
 										</div>							 
<!-- 										<div class="control-group"> -->
<%-- 											<label class="control-label admin_Label" for="sliderInfo"><spring:message --%>
<%-- 													code="menu.sliderInfo.label" /></label> --%>
<!-- 											<div class="controls"> -->
<%-- 												<form:textarea cols="10" rows="5" class="input-large" --%>
<%-- 													name="txtsliderInfo" id="sliderInfo" path="description"/> --%>
<!-- 											</div> -->
<!-- 										</div> -->

										<div class="control-group">
											<label class="control-label admin_Label" for="album"><spring:message
													code="menu.albumname.label" /></label>
											<div class="controls">
												<form:select name="albumname" id="albumname" 
													path="albumID" > 
												
													 	<c:forEach items="${albumList}" var="album">
                                                  	<c:choose>
                                                  	<c:when test="${chooseAlbum.id == album.id }">
                                                  		<option value="${album.id}" selected>
															<c:out value="${album.name}" />
														</option>
                                                  	</c:when>
                                                  	   <c:otherwise>
                                                                <option value="${album.id}">${album.name}</option>
                                                            </c:otherwise>
                                                  	</c:choose>
														
													</c:forEach>
												</form:select>
											</div>
										</div>
										<div class="control-group">
											<label class="control-label admin_Label" for="sliderImage"><spring:message
													code="menu.sliderImage.label" /></label>
											<div class="controls">
												<input type="file" class="input-large" accept="gif|jpeg|bmp|png|jpg" size="50"
													name="sliderImage" id="sliderImage"/>
											</div>
										</div>									
										<input type="hidden" value="0" id="currentFieldCount" />
										<input type="hidden" value="${image.id}" name="imageId">
										<div class="control-group">
											<div class="controls">

												<button type="submit" class="btn btn-primary offset2"
													value="addProduct" name="action">
													<spring:message code="menu.updateSlider.label" />
												</button>
												<a href="./listSlider" class="btn btn-primary "
													style="font-size: 12px !important; margin-left: 20px"><spring:message
														code="menu.cancel.label" /></a>
											</div>
										</div>
									</form:form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
